import { Navigate } from 'react-router-dom'
import { getToken } from '@/utils/token'

// Navigate 是内置组件，常用于路由重定向

export default function AuthRoute({children}) {
  if(getToken()){
    return(
      <>
      {children}
      </>
    )
  }else{
    return <Navigate to='/login' replace/>
  }
}
